import './index.css'
import { Spin } from "antd";
import React, { Suspense, lazy } from "react"; // 懒加载
import { Link, Route, Switch } from "react-router-dom";
let Test = lazy(() => import("./components/Test"));// 懒加载组件

export default function App() {
  return (
    <div>
      App
      <Link to="/test1">test</Link>
      <Suspense fallback={<div className="box"><Spin className='spin'></Spin></div>}>
        <Switch>
          <Route path="/test1" component={Test} />
        </Switch>
      </Suspense>
    </div>
  );
}
